<?php

/** @noinspection PhpPropertyCanBeReadonlyInspection */

declare(strict_types=1);

namespace DreamCat\Array2Class\Annotation;

use Attribute;
use JetBrains\PhpStorm\Immutable;
use JetBrains\PhpStorm\Pure;

/**
 * 描述对象属性
 * @author vijay
 */
#[Attribute(Attribute::TARGET_PROPERTY)]
#[Immutable]
class ObjectAttribute
{
    /**
     * @param string $alias 字段别名
     * @param bool $ignore 是否忽略
     */
    public function __construct(private string $alias = "", private bool $ignore = false)
    {
    }

    /**
     * @return string
     */
    #[Pure]
    public function getAlias(): string
    {
        return $this->alias;
    }

    /**
     * @return bool
     */
    #[Pure]
    public function isIgnore(): bool
    {
        return $this->ignore;
    }
}


# end of file
